package com.yzcrm.erp.crm.common;

public enum CheckStatusEnum {
    /**
     * CheckStatus Enum
     * 0 未审核 1 审核通过 2 审核拒绝 3 审核中 4 已撤回 5草稿 6 作废
     */
    CHECK_STATUS_WAIT("wait",0,"未审核","NULL"),
    CHECK_STATUS_OK("ok",1,"审核通过","NULL"),
    CHECK_STATUS_REJECTED("rejected",2,"审核拒绝","NULL"),
    CHECK_STATUS_CHECKING("checking",3,"审核中","NULL"),
    CHECK_STATUS_UNDO("undo",4,"已撤回","NULL"),
    CHECK_STATUS_DRAFT("draft",5,"草稿","NULL"),
    CHECK_STATUS_DISUSE("disuse",6,"作废","NULL"),

    CRM_NULL("NULL",0,"NULL","NULL")
    ;

    private final String name;
    private final int  type;
    private final String remarks;
    private final String num; //编码前缀
    CheckStatusEnum(String name, int type, String remarks, String num) {
        this.name = name;
        this.type = type;
        this.remarks = remarks;
        this.num = num;
    }
    public static CheckStatusEnum parse(int type) {
        for (CheckStatusEnum Enum : CheckStatusEnum.values()) {
            if (Enum.getType()==type) {
                return Enum;
            }
        }
        return CRM_NULL;
    }

    public static CheckStatusEnum parse(String name) {
        for (CheckStatusEnum Enum : CheckStatusEnum.values()) {
            if (Enum.getName().equals(name)) {
                return Enum;
            }
        }
        return CRM_NULL;
    }

    public String getName() {
        return name;
    }

    public int getType() {
        return type;
    }

    public String getRemarks() {
        return remarks;
    }
    
    public String getNum() {
        return num;
    }

}
